package com.koron.css2.newProjectCenter.vo.gcjs;

import lombok.Data;

//工建平台
@Data
public class GJResponseData {
	
	
	/**
	 * 返回类封装
	 */
	
	public static final int SUCCESS_CODE = 0;
	
	public static final int FAIL_CODE = -1;
	
	public static final int UrlFAIL_CODE = 10000;

	/**
	 * 接收失败，接收审批数据失败
	 */
	public static final int FAIL_CODE_01 = 1001;

	/**
	 * 参数为空
	 */
	public static final int FAIL_CODE_05 = 1000;

	/**
	 * 接收失败，没有找到受理信息
	 */
	public static final int FAIL_CODE_02 = 1002;

	/**
	 * 接收失败，状态值错误
	 */
	public static final int FAIL_CODE_03 = 1003;

	/**
	 * 接收失败，参数转换失败
	 */
	public static final int FAIL_CODE_04 = 1004;
	private int errcode;
	
	private String message;



	private Object data;
	
	
	public final static GJResponseData success(String description) {
		GJResponseData data = new GJResponseData();
		data.setErrcode(GJResponseData.SUCCESS_CODE);
		data.setMessage(description);
		return data;
	}
	
	public final static GJResponseData success(Object object, String description) {
		GJResponseData data = new GJResponseData();
		data.setErrcode(GJResponseData.SUCCESS_CODE);
		data.setMessage(description);
		data.setData(object);
		return data;
	}
	
	
	public final static GJResponseData faill(String description) {
		GJResponseData data = new GJResponseData();
		data.setErrcode(GJResponseData.FAIL_CODE);
		data.setMessage(description);
		return data;
	}
	
	public final static GJResponseData faill(Object object, String description) {
		GJResponseData data = new GJResponseData();
		data.setErrcode(GJResponseData.FAIL_CODE);
		data.setMessage(description);
		data.setData(object);
		return data;
	}
	
	public final static GJResponseData Urlfaill(Object object, String description) {
		GJResponseData data = new GJResponseData();
		data.setErrcode(GJResponseData.UrlFAIL_CODE);
		data.setMessage(description);
		data.setData(object);
		return data;
	}
	
	public final static GJResponseData faill(int code, String description) {
		GJResponseData data = new GJResponseData();
		data.setErrcode(code);
		data.setMessage(description);
		return data;
	}


}
